﻿using System;
using System.Collections.Generic;
using System.Text;
using VSAddInFramework;
using System.Windows.Forms;
using Extensibility;
using EnvDTE;
using EnvDTE80;
using Microsoft.VisualStudio.CommandBars;

namespace LazyAddIn
{
    class TestCmd : VSCommand
    {
        public TestCmd()
            : base("Test", "Test", "It is a test command", true, 59,
            (int)vsCommandStatus.vsCommandStatusSupported + (int)vsCommandStatus.vsCommandStatusEnabled,
            (int)vsCommandStyle.vsCommandStylePictAndText, vsCommandControlType.vsCommandControlTypeButton)
        {

        }

        public override bool _Execute()
        {
            MessageBox.Show("TestCmd");
            return true;
        }

        public override void CreateCommandUI()
        {
            m_codeWindowButton = VSCommandUIMgr.AddCommandToToolbar(this, "Code Window");
        }

        public override void DestoryCommandUI()
        {
            if (m_codeWindowButton != null)
            {
                m_codeWindowButton.Delete(System.Type.Missing);
            }
        }

        private CommandBarButton m_codeWindowButton;
    }
}
